package com.simulate2.demo.controller;

import com.simulate2.demo.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.Date;

@Controller
public class UserController {

    @Resource
    private UserService userService;

    @RequestMapping("/produceUser")
    public String produceUser(String p_date, String p_num) {
        Date date1 = new Date();                    //获得当前时间
        System.out.println("开始时间："+date1);
        userService.produceUser(Integer.parseInt(p_num), Integer.parseInt(p_date));
        Date date2 = new Date();                    //获得当前时间
        System.out.println("结束时间："+date2+"  共耗时："+(date2.getTime()-date1.getTime()));
        return "index";
    }
}
